//
//  NotPromptBoxView.m
//  wjstoreboardtest
//
//  Created by 杜文杰 on 2018/10/24.
//  Copyright © 2018年 dwj. All rights reserved.
//

#import "NotPromptBoxView.h"
@interface NotPromptBoxView()
@property (nonatomic, strong) UIButton * selectedBtn;
@property (nonatomic, strong) NSString *chooseType;// 选中（1）、未选中（2）
@end

@implementation NotPromptBoxView
- (IBAction)chooseBtnAction:(id)sender {
    self.selectedBtn = sender;
    self.selectedBtn.selected = !self.selectedBtn.selected;
    if (self.selectedBtn.selected) {
        [self.selectedBtn setBackgroundImage:[UIImage imageNamed:@"btn_choose.2"] forState:UIControlStateSelected];
        self.chooseType = @"1";
    }else{
        [self.selectedBtn setBackgroundImage:[UIImage imageNamed:@"btn_choose.1"] forState:UIControlStateSelected];
        self.chooseType = @"2";
    }
    
}
- (IBAction)knowBtnAction:(id)sender { // 知道了存储一个本地标识
    [self hidden];
}


+ (instancetype)notPromptBoxView{
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
    
}
-(void)awakeFromNib{
    
    [super awakeFromNib];
    
}

//出现
- (void)show{
    [[UIApplication sharedApplication].delegate.window addSubview:self];
    [UIView animateWithDuration:.15 animations:^{
        self.alpha = 1;
    }];
}

//消失
- (void)hidden{
    [UIView animateWithDuration:.15 animations:^{
        self.alpha = 0 ;
    } completion:^(BOOL finished) {
        [self removeFromSuperview];
    }];
}
@end
